set=ISO-8859-1">etitle>Chapx
r 14. Th0tsmb.ct fteile itle>elinkcrelsshome" href="index.html" itle="SAMBA Deselop&vs
Guide">elinkcrelssup" href="pt03.html" itle="Pdr III. Samba Subsystems">elinkcrelssprevious" href="registry.html" itle="Chapx
r 13. Th0tregistry subsystem">elinkcrelssnixt" href="wins.html" itle="Chapx
r 15. Samba WINS I t&
nals">e/heap> slink="#840084" allnk="#0000FF>msuch4n classnavheaper"ms nble width="100%" stmmury="Navigaary.theaper"ms rr< h ctlspan="3" allgn="cdex
r>nChapx
r 14. Th0tsmb.ct fteile hr rr< rr< d width="20%" allgn="left>n>csaccesskey="p" href="registry.html">Prevesa> Nextesa> lang="en"msuch4n classtitlepage"msuchmsuchmsh24n classtitle>n>csen m="pdrscnllresa>Chapx
r 14. Th0tsmb.ct fteilenChristnspan> sspan4n classsuren m>nHertelamhbruptlemsptlemsuchmsp n classpubdata">November 1997Tnble of Ct "dexstnb>n>cshref="pdrscnl.html#ass=19380lrLexical Analysistna>tnspan>amemeltdmsuSuccesnspan4n classsect2>n>cshref="pdrscnl.html#ass=19455>nHandlinl of Whitespacetna>tnspan>amemeltesnspan4n classsect2>n>cshref="pdrscnl.html#ass=19501">Handlinl of Lcne Ct "inuatLDItnspan>amemeltesnspan4n classsect2>n>cshref="pdrscnl.html#ass=19554lrLcne Ct "inuatLDI Quirkstna>tnspan>amemelill Optduccesnspan4n classsect1>n>cshref="pdrscnl.html#ass=19635>nSyntaxtna>tnspan>amemeltdmsuSuccesnspan4n classsect2>n>cshref="pdrscnl.html#ass=19694lrAbouttpdrams.ctna>tnspan>amemelill Optducill Optlemsuch4n classsect1> lang="en"msuch4n classtitlepage"msuchmsuchmsh24n classtitle> tfylessclear: both>n>csen m="ass=19380lresa>Lexical Analysistnh2 Optlemsptlemsuchmsptlemsptlemsp>
Basically, trgteile is processedcun a line by line basls. Trerecare
four types ustlines lre care recogniz
dFbycth0tlexical analyzer
(pdrams.c):
elimsp>
Blanktlines - Lcnes"nt4"aininl onlytwhitespace.
Comndextlines - Lcnes"beginninl s th eilrgr a semi-coloncurca
pound slgn (';'curc'#').
Sehery. heapertlines - Lcnes"beginninl s th an4op&n square brdcket ('[').
Pdrametertlines - Lcnes"beginninl s th any olrgr ch>
ahe&v.
(Th0tdefaulxtline type.)
elimsp>
- Sehery. names
- Pdrametertnames
- Pdrametertsalues
lang="en"msuch4n classtitlepage"msuchmsuchmsh34n classtitle>n>csen m="ass=19455>nesa>Handlinl of Whitespacetnhbruptlemsptlemsuchmsptlemsptlemsp>
Whitespace is defiuedFas all"cha
ahe&vs
recogniz
dFbycth0tisspace()
funhery. (see ctype(3C)) excepttiorllre newline cha
ahe&v ('\n')
Th0tnewline is exclud
dFbecause
ixlidentifiesltn/ endcusttn/ line.
elimsp>
Th0tlexical analyzer scanstpdsttwhite space ax tn/ beginninl usta line.
Sehery. nd"tpdrametertnames mayant4"ain i t&
naltwhite space. All
whitespace s thin a en mais co 2ress&d loaa sinlle space ch>
ahe&v.
I t&
naltwhitespace s thin a pdrametertsalueais kepttverbatLm s th
tn/ exceptry. ustcarriage returntcha
ahe&vs
('\r'),Fall"of shich
are removed.
Leapinl nd"alrailinl whitespace is removedlfl
ennames nd"asalues.
lang="en"msuch4n classtitlepage"msuchmsuchmsh34n classtitle>n>csen m="ass=19501">esa>Handlinl of Lcne Ct "inuatLDI
Lonl sehery. heapertnd"tpdrametertlines mayabe extendedFacross
mulxi220Flines"bycusecusttn/ bdckslashlcha
ahe&v ('\\'). Lcne
ct "inuatLDI is ignor
dtiorlblanktand comndextlines.
Isttn/ ldstt(non-whitespace)lcha
ahe&v s thin a sehery. heapertorlon
atpdrametertlinecis ntbdckslash, trgn lr/ eexxtline will"be
(logically) concatonatadls th lrs
current line by th0tlexical
analyzer. Forlexa 220:
o/listing">
pdram en ma= pdrametertsalueasfringt\
s th line ct "inuatLDI.
Woul"abe reapFaso/listing">
pdram en ma= pdrametertsalueasfringttttts th line ct "inuatLDI.
Note lre ctrerecaretf ve spacestiollowcnl trg word 'sfring',
re2resentinl trg one space betwede 'sfring'tand '\\'ciuctn/ top
lcne, plustoce four preceedcnl trg word 's th'ciuctn/ sctt4d line.
(Yes, I'm coun cnl trg indenxaary..)
Line ct "inuatLDI ch>
ahe&vs
are lgnor
dcun blanktlines and atltn/ end
ustcomndexs. Trey are *only*
recogniz
dFs thin sehery. nd"tpdrameter
lines.
lang="en"msuch4n classtitlepage"msuchmsuchmsh34n classtitle>n>csen m="ass=19554lresa>Lcne Ct "inuatLDI Quirkstnhbruptlemsptlemsuchmsptlemsptlemsp>Note lretiollowcnl exa 220:o/listing">
pdram en ma= pdrametertsalueasfringt\
tttt\
tttts th line ct "inuatLDI.
Th0tmidd20Flinecis *nol* pdrsedFas a blanktlineFbecause
ixlistf rst
concatonatadls th lrs
top line. Trecresulxlis
o/listing">
pdram en ma= pdrametertsalueasfringttttttttts th line ct "inuatLDI.
Trgt
">e is true fortcomndextlines.o/listing">
pdram en ma= pdrametertsalueasfringt\
;tcomndext\
tttts th atcomndex.
Tris"becomes:o/listing">
pdram en ma= pdrametertsalueasfringttttt;tcomndexttttts th atcomndex.
On a sehery. heapertlcne, lrg"closcnl brdcket (']')ais consider
dFa
aivminatcnl ch>
ahe&v, nd"alrg"rest usttn/ line is ignor
d. Treclines
o/listing">
[ sehery. en ma] garbage \
pdram en maa= salue
are reapFaso/listing">
[sehery. name]
pdram en ma= salue
lang="en"msuch4n classtitlepage"msuchmsuchmsh24n classtitle> tfylessclear: both>n>csen m="ass=19635>nesa>Syntaxtnh2 Optlemsptlemsuchmsptlemsptlemsp>Trgt
yntax usttn/ smb.ct fteilecis nstiollows:o/listing">
<eile>t :== { <sehery.>t} EOF
<sehery.>t :== <sehery. heaper>t{ <pdrametertline>t}
<sehery. heaper>t :== '[' NAMEc']'
<pdrametertline>t :== NAMEc'=' VALUE NL
Basically, tris meanstlre elimsp>
ateilecis mape up ustzerocortmore sehery.s,"and is tivminatedFby
en EOF (we knewtlre ).
A sehery. is mape up usta sehery. heapertiollow
dFbyczerocortmore
pdrametertlines.
A sehery. heapertis identified by en4op&ncnl brdcket nd"
tivminatedFby lrg"closcnl brdcket. TrecenclosedFNAMEcidentifies
tn/ sehery..
A pdrametertlinecis tleidedli toaa NAMEcand a VALUE. Trec*f rst*
equal slgncun lr/ linecsepdratesltn/ NAMEcfl
enlre VALUE. Tre
VALUE is tivminatedFby a eewline cha
ahe&v (NLa= '\n').
lang="en"msuch4n classtitlepage"msuchmsuchmsh34n classtitle>n>csen m="ass=19694lresa>Abouttpdrams.ctnhbruptlemsptlemsuchmsptlemsptlemsp>
Th0tpdrscnltustoce ct figteilecis n bit
unusual ifcyou are us&d lo
lex, yacc, bisDI, etc. Both lexical analysis (scanncnl) nd"tpdrscnl
are performedFby pdrams.c. Valuescape loape"asia callbdcks lo
loappdrm.c.
n>csaccesskey="p" href="registry.html">Prevesa> Upesa>Nextesa>Chapx
r 13. Th0tregistry subsystem Home Chapx
r 15. Samba WINS I t&
nals